<?php
include('teacher_lock.php');
?>

<body>
<?php 
	$myUsername=$_SESSION['login_user'];
	$sectionQuery="SELECT * FROM section WHERE instructor='$myUsername'";
	
	$sectionResult=mysql_query($sectionQuery);
?>
<table align="center">
<tr><td width="200">Welcome <?php echo $_SESSION['login_user']; ?></td>
<td width="400" align="center"><h1>Instructor Schedule</h1></td>
<td width="200" align="right"><a href="logout.php">Logout</a></td>
</tr>
</table>

<center>

<table width="800">
	<tr>
		<td width="200">Hello <?php $_SESSION['login_user'] ?></td>
		<td width="400"></td>
			<td align="right"> 
		<a  href="logout.php">Logout</a>
	</td>
</tr>
<tr>
		<td>Welcome to Scheduletron!</td>
		<td></td>
		<td></td>
</tr>
</table>

<table border="1" width="800">
<tr>
		<td width="100">Class Number</td>
		<td width="50">Section</td>
		<td width="250">Class Name</td>
		<td width="120">Days/Time</td>
		<td width="40">Room</td>
</tr>

<!-- add loop to output rows -->

<?php
	//outputs classes being taught
	while($sectionRow=mysql_fetch_row($sectionResult))
   {
		$courseQuery="SELECT * FROM course where id=$sectionRow[0]";
		$courseRow=mysql_fetch_row(mysql_query($courseQuery));
		
		
		echo "<tr>";
		echo "<td>".$courseRow[3]."</td>";
		echo "<td>".$sectionRow[1]."</td>";
		echo "<td>".$courseRow[1]."</td>";
		echo "<td>".$sectionRow[4]."</td>";
		echo "<td>".$sectionRow[5]." ".$sectionRow[6]."</td>";
   }

?>


</table>
</br>
<table width="800">
	<tr>
		<td width="200">

		</td>
		<td></td>
		<td width="200" align="right"><input type="Submit" value="Message Administrator"></td>
</tr>
</table>
</center>
</body>
